﻿package cn.antscrpt.antLib.logo 
{
	import org.papervision3d.core.proto.MaterialObject3D;
	import org.papervision3d.objects.DisplayObject3D;
	
	/**
	 * ...
	 * @author AntScript
     * @blog  http://www.antscript.cn
	 */
	public class Logo3D extends DisplayObject3D
	{
		private var _material:MaterialObject3D;
		
		protected var frameTriangles:Vector.<CustomTriangle3D> = new Vector.<CustomTriangle3D>();
		protected var centerTriangles:Vector.<CustomTriangle3D> = new Vector.<CustomTriangle3D>();
		
		public function Logo3D(material:MaterialObject3D) 
		{
			_material = material;
			init();
		}
		
		private function init():void
		{
			for (var i:int = 0; i < PointData.FRAME_POINT.length; i++) 
			{				
				this.addChild(new CustomTriangle3D(_material, PointData.FRAME_POINT_3D[i]), "frame" + i);
				frameTriangles.push(this.getChildByName("frame" + i));
			}
			for (i = 0; i < PointData.SHAPE_POINT.length; i++) 
			{
				this.addChild(new CustomTriangle3D(_material, PointData.SHAPE_POINT_3D[i]), "center" + i);
				centerTriangles.push(this.getChildByName("center" + i));
			}
		}
		
	}
	
}